import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import Hightlight from "@/core/utils/hightlight";
import wow from 'wowjs'
import 'wowjs/css/libs/animate.css';
import {request} from "@/core/AxiosConfig";
import store from "@/store";
import router from "@/core/RouterConfig";
Vue.prototype.$wow = wow

Vue.config.silent = true
Vue.use(ElementUI)
Vue.use(Hightlight)

  Vue.prototype.axios = request
  Vue.config.productionTip = false

  // 对于一些需要监视的sessionStorage的变量可任意选择使用resetSetItem函数，当然，也要用监视器
  /**
   *      window.addEventListener('setItem',()=>{
   *         this.list=JSON.parse(sessionStorage.getItem('notelist'))
   *         this.isSearchOrFavorite=JSON.parse(sessionStorage.getItem('isSearchOrFavorite'))
   *       })
   */
  Vue.prototype.resetSetItem = function (key, newVal) {
    switch (key) {
      case 'doclist':
      case 'updateText':
        var newStorageEvent = document.createEvent('StorageEvent');
        var storage = {
          setItem: function (k, val) {
            sessionStorage.setItem(k, val);
            // 初始化创建的事件
            newStorageEvent.initStorageEvent('setItem', false, false, k, null, val, null, null);
            // 派发对象
            window.dispatchEvent(newStorageEvent)
          }
        }
        return storage.setItem(key, newVal);
      default:
        break
    }
  }
// 进入页面前校验


Vue.config.productionTip = false
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app')
